﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GeneticAlgorythm.Algorythm;

namespace GeneticAlgorythm.Problem
{
    public class FabricProblem : ProblemInstance
    {
        private float[,] costsMatrix;
        private float[,] cargoQuantityMatrix;
        ObjectiveFunctionCalculator calculator;

        public FabricProblem(float[,] costsMatrix, float[,] cargoQuantityMatrix, ObjectiveFunctionCalculator calculator)
        {
            this.costsMatrix = costsMatrix;
            this.cargoQuantityMatrix = cargoQuantityMatrix;
            this.calculator = calculator;
        }

        public float calculateObjectiveFunctionValue(Chromosome chromosome)
        {
            return calculator.calculate(chromosome, cargoQuantityMatrix, costsMatrix);

        }

        public float[] calculateObjectiveFunctionValue(List<Chromosome> chromosomes)
        {
            return calculator.calculate(chromosomes, cargoQuantityMatrix, costsMatrix);

        } 
    }
}
